/*
 * @Author: songjian
 * @Date: 2018-10-26 15:24:24
 * @Last Modified by: songjian
 * @Last Modified time: 2018-10-26 15:26:35
 */

import React from 'react';
import { MOBILE_REG } from 'utils/consts';
import { Input, Button } from 'antd';
import { Link } from 'react-router-dom';
import LogoHeader from '../../../components/Header/LogoHeader';

import styles from './index.module.less';

export default class ChangeMobile extends React.Component {
  state = {
    // hasEnteredPwd: true,
    hasEnteredPwd: false,
  };

  render() {
    const { hasEnteredPwd } = this.state;
    const rightContent = (
      <div className={styles.menuBox}>
        <Link className={styles.menuItem} to='/'>首页</Link>
        <Link className={styles.menuItem} to='/login'>登录</Link>
        <Link className={styles.menuItem} to='/register'>注册</Link>
        <Link className={styles.menuItem} to='/'>帮助中心</Link>
      </div>
    );

    return (
      <React.Fragment>
        <LogoHeader moduleName='修改手机号' rightContent={rightContent} />
        <div className={styles.box}>
          <div className={styles.content}>
            {
              hasEnteredPwd ?
                (
                  <React.Fragment>
                    <div className={styles.title}>请输入正确的手机号，进行操作</div>
                    <Input className={styles.mobile} type="text" placeholder="请输入手机号"/>
                    <Input className={styles.validCode} type="text" placeholder="短信验证码"/>
                    <Button className={styles.getCode}>获取验证码</Button>
                  </React.Fragment>
                ) :
                (
                  <React.Fragment>
                    <div className={styles.title}>请输入账号登陆密码，辅助更换手机号</div>
                    <Input className={styles.password} type="text" placeholder="请输入登陆密码"/>
                  </React.Fragment>
                )
            }
            {/* <Button className={styles.btn} { hasEnteredPwd ? onClick(1) : onClick(2) }>验证</Button> */}
            <Button className={styles.btn}>验证</Button>
            <div className={styles.tips}><i className={styles.tip}>遇到麻烦？</i>请致电客服协助您400-681-6018(周一至周日 9:30-17:00)</div>
          </div>
        </div>
      </React.Fragment>
    );
  }
}
